<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <base href="<%=basePath%>">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"> 
 	<%@ include file="/common/importJsCss.jsp" %>
 	<script type="text/javascript">
	</script>
  </head>  
  <body>
	<div class="container">
        <div class="page-header">
            <h2>跳转路径问题</h2>
        </div>
<pre class="prettyprint linenums">
包含&lt;base href="&lt;%=basePath%&gt;"&gt;:
href="index.jsp"对应http://127.0.0.1/istudy/index.jsp
href="/index.jsp"对应http://127.0.0.1/index.jsp
href="../index.jsp"对应http://127.0.0.1/index.jsp
href="#"对应http://127.0.0.1/istudy/#
不包含&lt;base href="&lt;%=basePath%&gt;"&gt;:
href="index.jsp"对应http://127.0.0.1/istudy/snippets/javascript/index.jsp
href="/index.jsp"对应http://127.0.0.1/index.jsp
href="../index.jsp"对应http://127.0.0.1/istudy/snippets/index.jsp
href="#"对应http://127.0.0.1/istudy/snippets/javascript/href.jsp#
</pre>
	<a class="btn" href="index.jsp">index.jsp</a><a class="btn" href="/index.jsp">/index.jsp</a><a class="btn" href="../index.jsp" >../index.jsp</a><a class="btn" href="#" >#</a>
    </div>
  </body>
</html>
